//
//  z_MD5.m
//  Template
//
//  Created by zhoubl on 13-6-5.
//  Copyright (c) 2013年 cdeledu. All rights reserved.
//

#import "z_MD5.h"
#import "NSString+MD5.h"

@implementation z_MD5

+ (NSString *)keyValueWithMD5:(NSString *)pkey uName:(NSString *)uname uPwd:(NSString *)upwd uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@",uname,upwd,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

+ (NSString *)keyValueWithMD5:(NSString *)pkey uEmal:(NSString *)email uPhone:(NSString *)phone uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@",email,phone,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
//课程列表
+ (NSString *)keyValuelistWithMD5:(NSString *)pkey uCourse:(NSString *)course uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",course,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
//课程详情
+ (NSString *)keyValueInfoWithMD5:(NSString *)pkey uCourse:(NSString *)course uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",pkey,time,course];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
+ (NSString *)keyValueWithMD5:(NSString *)pkey uTime:(NSString*)time RecommendLevel:(NSString*)recommendLevel
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",recommendLevel,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
+(NSString *)keyValueWithMD5:(NSString *)pkey  uTime:(NSString *)time Uid:(NSString*)uid
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",uid,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
+(NSString *)keyValueWithMD5:(NSString *)pkey  uTime:(NSString *)time 
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@",pkey,time];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}
#pragma mark GMMethod
+ (NSString *)keyValueWithMD5:(NSString *)pkey pFirst:(NSString *)first pSecond:(NSString *)second pThird:(NSString *)third pFourth:(NSString *)fourth
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@%@",first,second,third,fourth,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

+ (NSString *)keyValueWithMD5:(NSString *)pkey pFirst:(NSString *)first pSecond:(NSString *)second pThird:(NSString *)third
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@",first,second,third,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

+ (NSString *)keyValueWithMD5:(NSString *)pkey pFirst:(NSString *)first pSecond:(NSString *)second
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",first,second,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

+ (NSString *)keyValueWithMD5:(NSString *)pkey pFirst:(NSString *)first
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@",first,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

+ (NSString *)keyValueWithMD5:(NSString *)pkey
{
    return [pkey md5UsingEncoding:NSUTF8StringEncoding];
}


//获取学习计划详细内容
+ (NSString *)keyValueWithMD5:(NSString *)pkey uCourse:(NSString *)course uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@",course,time,pkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

//学习计划加密
+ (NSString *)keyValueWithMD5:(NSString *)personkey uUser:(NSString *)userID uCourse:(NSString *)couseId uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@",userID,couseId,time,personkey];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}


// 获取学员已开课程
+ (NSString *)keyValueWithMD5:(NSString *)personkey uUser:(NSString *)userID BatchID:(NSString *)batchID uTime:(NSString *)time
{
    NSString *keyStr = [NSString stringWithFormat:@"%@%@%@%@",personkey,userID,batchID,time];
    return [keyStr md5UsingEncoding:NSUTF8StringEncoding];
}

@end
